package com.aaa.whj.Controller;

import com.aaa.whj.entity.AliPay;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: whj
 * @Version 1.0
 * @Date: 2022/11/15  16:17
 */
@RestController
public class Controller {

    @GetMapping("/com")
    public Map<String,Object> hello(){
        Map<String,Object> map=new HashMap<>();
        map.put("name","汪豪杰");
        map.put("age",16);
        return map;
    }
    @Autowired
    private AliPay aliPay;
    @GetMapping("/haha")

    public AliPay haha(){
        return aliPay;
    }


    @Value("${server.port}")
    private Integer port;

    @GetMapping("www")

    public String www(){
        return "服务器的端口号:"+port;
    }

    @Value("${student.name}")
    private String name;

    @GetMapping("whj")

    public String whj(){
        return "服务器的端口号:"+port+";姓名:"+name;
    }
}
